﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// add
using System.Windows.Forms;
using System.Reflection;
using System.IO;

namespace FormBaseLib
{
    public enum enumEnvironment { Production, Development, Testing }
    public enum enumEntryMode { Init, View, Add, Update, Query, Browse }

    internal static class CProject
    {
        public static CApplication mApp = new CApplication();
        static CProject()
        {
            string s1;

            mApp.mbDebug = true;
            mApp.mTimeStart = DateTime.Now;
            mApp.mTimeRelease = new DateTime(2014, 6, 21, 22, 0, 0);
            mApp.msNamespace = @"http://www.luckstar.com.tw";   //http://tempuri.org/DataSetProjectRun.xsd
            mApp.msCompanyID = "CompanyID";
            mApp.msSystemID = "SystemID";
            mApp.msProjectID = "ProjectID";
            mApp.msProductName = Application.ProductName;
            mApp.msProductVersion = Application.ProductVersion;
            mApp.msAssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            // Windows predefines:
            // i.e.
            //msPathAppStartup = "D:\\...\\FormBase10\\FormBase\\FormBase\\bin\\Debug"
            //msPathAppDataUserRoaming = "C:\\Users\\honda_chen\\AppData\\Roaming"
            //msPathAppDataUserAll = "C:\\ProgramData"
            //msPathAppDataUserLocal = "C:\\Users\\honda_chen\\AppData\\Local"
            //msPathAppTemp = "C:\\Users\\honda_chen\\AppData\\Local\\Temp\\"
            mApp.msPathDataUserRoaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);  // current roaming user
            mApp.msPathDataUserAll = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);  // all user
            mApp.msPathDataUserLocal = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);   // local user only
            mApp.msPathExeRoot = Application.StartupPath; // The .exe Startup Path.
            //s1 = Path.GetTempPath();
            //mApp.msPathSystemTemp = s1.Remove(s1.Length - 1, 1);  // Consistency with aboves: no "Back-Slash" in suffix.

            mApp.ResetCounter();
            mApp.mAction.BeginAction("FormBaseLib.CProject() Begin");
        }
    }
}
